package com.dtream.nacos.controller;

import com.dtream.nacos.service.ProducerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ProducerController {
    @Autowired
    private ProducerService producerService;

    @Value(value = "${server.port}")
    private String port;

    @GetMapping(value = "/echo/{string}")
    public List<String> echo(@PathVariable String string) {
        return producerService.findList();
    }

    @GetMapping("/getPort")
    public String getPort() {
        return "提供者端口为:" + port;
    }
}
